import com.mchange.v2.c3p0.ComboPooledDataSource
import org.codehaus.groovy.grails.commons.ConfigurationHolder as CH

beans = {
	securityEventListener(org.gruposp2p.proyectokarma.util.SecurityEventListener)
	
	/**
	* c3P0 pooled data source that allows 'DB keepalive' queries
	* to prevent stale/closed DB connections
	*/
   dataSource(ComboPooledDataSource) { bean ->
	 bean.destroyMethod = 'close'
	 user = CH.config.dataSource.username
	 password = CH.config.dataSource.password
	 driverClass = CH.config.dataSource.driverClassName
	 jdbcUrl = CH.config.dataSource.url
	 //connection test settings
	 idleConnectionTestPeriod = 2 * 60 * 60 //2 hours
	 testConnectionOnCheckin = true
	 initialPoolSize=10
	 minPoolSize=10
	 maxPoolSize=100
	 //maxConnectionAge=0
	 //maxIdleTime=0
	 //maxStatements=0
	 //maxStatementsPerConnection=0
	 //c3p0.acquire_increment
	 //c3p0.timeout
	}

}
